package com.fesine.learn;
import org.apache.log4j.Logger;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
 * @描述: 启动Dubbo服务⽤的MainClass.
 */
public class DubboProvider {
    private static final Logger logger = Logger.getLogger(DubboProvider.class);
    public static void main(String[] args) {
        try {
            ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext
                    ("classpath:spring.xml");
            context.start();
        } catch (Exception e) {
            logger.error("----->dubbo服务启动失败:", e);
        }
        synchronized (DubboProvider.class) {
            while (true) {
                try {
                    logger.info("----->服务已经启动！");
                    DubboProvider.class.wait();
                } catch (InterruptedException e) {
                    logger.error("----->同步报错", e);
                }
            }
        }
    }
}